# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Jobs.V2.Model.CompensationInfo do
  @moduledoc """
  Job compensation details.

  ## Attributes

  *   `amount` (*type:* `GoogleApi.Jobs.V2.Model.Money.t`, *default:* `nil`) - Deprecated. Use entries instead.

      Optional.

      The amount of compensation or pay for the job.
      As an alternative, compensation_amount_min and
      compensation_amount_max may be used to define a range of
      compensation.
  *   `annualizedBaseCompensationRange` (*type:* `GoogleApi.Jobs.V2.Model.CompensationRange.t`, *default:* `nil`) - Output only. Annualized base compensation range. Computed as
      base compensation entry's CompensationEntry.compensation times
      CompensationEntry.expected_units_per_year.

      See CompensationEntry for explanation on compensation annualization.
  *   `annualizedTotalCompensationRange` (*type:* `GoogleApi.Jobs.V2.Model.CompensationRange.t`, *default:* `nil`) - Output only. Annualized total compensation range. Computed as
      all compensation entries' CompensationEntry.compensation times
      CompensationEntry.expected_units_per_year.

      See CompensationEntry for explanation on compensation annualization.
  *   `entries` (*type:* `list(GoogleApi.Jobs.V2.Model.CompensationEntry.t)`, *default:* `nil`) - Optional. Job compensation information.

      At most one entry can be of type
      CompensationInfo.CompensationType.BASE, which is
      referred as ** base compensation entry ** for the job.
  *   `max` (*type:* `GoogleApi.Jobs.V2.Model.Money.t`, *default:* `nil`) - Deprecated. Use entries instead.

      Optional.

      An upper bound on a range for compensation or pay for the job.
      The currency type is specified in compensation_amount.
  *   `min` (*type:* `GoogleApi.Jobs.V2.Model.Money.t`, *default:* `nil`) - Deprecated. Use entries instead.

      Optional.

      A lower bound on a range for compensation or pay for the job.
      The currency type is specified in compensation_amount.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Deprecated. Use entries instead.

      Optional.

      Type of job compensation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :amount => GoogleApi.Jobs.V2.Model.Money.t(),
          :annualizedBaseCompensationRange => GoogleApi.Jobs.V2.Model.CompensationRange.t(),
          :annualizedTotalCompensationRange => GoogleApi.Jobs.V2.Model.CompensationRange.t(),
          :entries => list(GoogleApi.Jobs.V2.Model.CompensationEntry.t()),
          :max => GoogleApi.Jobs.V2.Model.Money.t(),
          :min => GoogleApi.Jobs.V2.Model.Money.t(),
          :type => String.t()
        }

  field(:amount, as: GoogleApi.Jobs.V2.Model.Money)
  field(:annualizedBaseCompensationRange, as: GoogleApi.Jobs.V2.Model.CompensationRange)
  field(:annualizedTotalCompensationRange, as: GoogleApi.Jobs.V2.Model.CompensationRange)
  field(:entries, as: GoogleApi.Jobs.V2.Model.CompensationEntry, type: :list)
  field(:max, as: GoogleApi.Jobs.V2.Model.Money)
  field(:min, as: GoogleApi.Jobs.V2.Model.Money)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Jobs.V2.Model.CompensationInfo do
  def decode(value, options) do
    GoogleApi.Jobs.V2.Model.CompensationInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Jobs.V2.Model.CompensationInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
